import scrapy
from ..items import NewsItem


class CssSpider(scrapy.Spider):
    name = "css"
    start_urls = [
        'http://club.autohome.com.cn/bbs/threadqa-c-3462-63390745-1.html'
    ]

    def parse(self, response):
        for sel in response.css('div.w740'):
            item = NewsItem()
            print(sel.extract())
            print('\n')

            content = sel.xpath('text()').extract()
            print(content)
            # title1 = sel.xpath('//@title').extract()
            # if title1:
            #     item['title'] = title1
            # else:
            yield item


